package Memento;

import Memento.Memento;

//玩家类 存档 以及恢复 存档 都需要玩家类进行
public class Player {
    State playerState;

    public Player(State playerState)
    {
        this.playerState=playerState;
    }

    public Memento saveStateToMemento(){
        System.out.println(playerState.life);
        return new Memento(playerState);
    }

    public void getStateFromMemento(Memento Memento){
        playerState = Memento.getState();
    }
}
